

package com.hazelcast.jet.impl.operation;

import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;

import java.io.IOException;

public abstract class AsyncJobOperation extends AsyncOperation {

    private long jobId;

    protected AsyncJobOperation() {
    }

    protected AsyncJobOperation(long jobId) {
        this.jobId = jobId;
    }

    protected final long jobId() {
        return jobId;
    }

    @Override
    protected void writeInternal(ObjectDataOutput out) throws IOException {
        super.writeInternal(out);
        out.writeLong(jobId);
    }

    @Override
    protected void readInternal(ObjectDataInput in) throws IOException {
        super.readInternal(in);
        jobId = in.readLong();
    }
}
